/**  
 * All rights Reserved, Designed By www.woniuxy.com
 * @Title:  Account.java   
 * @Package com.woniu.domain   
 * @Description:    Description  
 * @author: 蜗牛学院  
 * @date:   2019年8月24日 上午11:27:41
 * @user:   Administrator  
 * @version V1.0 
 * @Copyright: 2019 www.woniuxy.com Inc. All rights reserved. 
 * 注意：本内容仅限于成都蜗牛创想科技有限公司，禁止外泄以及用于其他的商业目
 */ 
package com.woniu.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniu.dao.MusicDao;
import com.woniu.domain.Collect;
import com.woniu.domain.Music;
import com.woniu.domain.MusicType;
import com.woniu.utils.PageBean;
import com.woniu.utils.Queryv;

/**
 * @author Administrator
 *
 */
@Service
@Transactional
public class MusicServiceImpl implements MusicService{
	@Autowired
	MusicDao md;
	@Override
	public PageBean findMusicList(Queryv query) {
		PageBean pb = new PageBean();
		if(query==null) {
			pb.setPageNow(0);
		}else {
			pb.setPageNow(query.getPageNow());
		}
		List<Music> list = md.findMusicList(pb,query);
		int count = md.findCount(query);
		
		return new PageBean(pb.getPageNow(),count,list);
	}
	@Override
	public List<MusicType> findAllType() {
		return md.findAllType();
	}
	@Override
	public void collectMusic(Collect collect) {
			md.collectMusic(collect);
	}
	@Override
	public List<Collect> findCollectList(Collect collect) {
		
		return md.findCollectList(collect);
	}

}
